package com.message.api.base.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.message.api.base.entity.MsNotice;
import com.message.api.base.vo.MsNoticeVo;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author mzl
 * @since 2020-08-10
 */
public interface MsNoticeService extends IService<MsNotice> {

    /**
     * 条件查询
     *
     * @param example
     * @return
     */
    List<MsNoticeVo> findByExample(MsNoticeVo example);

    /**
     * 分页查询
     *
     * @param example
     * @param page
     * @return
     */
    Page<MsNoticeVo> findByPage(MsNoticeVo example, Page page);

    /**
     * 保存公告
     *
     * @param notice
     */
    @Transactional
    void saveNotice(MsNoticeVo notice);

    /**
     * 设置置顶状态
     *
     * @param id
     * @param top
     */
    @Transactional
    MsNotice setTop(Integer id, String top);

}
